package com.zhanggm.springcloud.jpa.service.impl;


import com.zhanggm.springcloud.jpa.entity.TbUser;
import com.zhanggm.springcloud.jpa.repository.TbUserRepository;
import com.zhanggm.springcloud.jpa.service.TbUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
@author Zhanggm
*/
@Service
public class TbUserServiceImpl implements TbUserService {

	@Resource
	private TbUserRepository userRepository;

	@Override
	public TbUser getUserByUsername(String username) {
		return userRepository.findByUsername(username);
	}

	@Override
	public TbUser getUserById(Integer id) {
		return userRepository.findById(id).get();
	}
}
